/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2023-04-12
 * Time: 14:00
 */
public class Test {
    public static void main(String[] args) {
        int[] array = {5,12,51,13,19,83,8,2};
        int n;
        int total = 0;
        for (int k = 0; k < array.length; k++) {  //上边已经定义一个局部变量k，这里的k是重复定义
            if(array[k] % 2 == 1)
                break;
            total += array[k];
        }
        System.out.println(total);
    }
}
